<?php
class  ApiCenter_VendorsApi_Model_Api2_Account_Password_Rest extends ApiCenter_VendorsApi_Model_Api2_Account_Password{
 
    /**
     * Retrieve collection instance for single order
     *
     * @param int $orderId Order identifier
     * @return Mage_Sales_Model_Resource_Order_Collection
     */
    protected function _authenticate($vendor,$password)
    {
 
        if (!$vendor->validatePassword($password)) {
            $this->_critical('Invalid login or password.');
        }
    
        if ($vendor->getConfirmation() && $vendor->isConfirmationRequired()) {
             
            $this->_critical('Your vendor account is not confirmed.');
        }
    
        if ($vendor->getStatus() ==$vendor::STATUS_PENDING){
            $this->_critical('Your vendor account is awaiting for approval.');
        }
    
        if ($vendor->getStatus() == $vendor::STATUS_DISABLED) {
    
            $this->_critical('Your vendor account has been suppended');
             
        }
    }
    
}